<%--
  Created by IntelliJ IDEA.
  User: 谢兴鑫
  Date: 2022/5/9
  Time: 上午 09:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--
  Created by IntelliJ IDEA.hhh
  User: 谢兴鑫
  Date: 2022/5/7
  Time: 下午 03:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>TIMO后台模板</title>
    <meta charset="utf-8">
    <link rel="shortcut icon" th:href="./images/favicon.ico" type="image/x-icon">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <!-- 引入css -->
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/static/css/plugins/font-awesome-4.7.0/css/font-awesome.css"
          media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all">
    <script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main.css" media="all">


    <script type="text/javascript">
        layui.use(['element', 'jquery'], function () {
            var element = layui.element, $ = layui.jquery;
            $(document).on("click", 'a', function () {
                if (!$(this)[0].hasAttribute("tab_id") || $(this).attr("tab_id") == '') {
                    return;
                }
                var layid = $(this).attr("tab_id");
                var text = $(this).text();
                var dataurl = $(this).attr("data-url");
                var tabs = $(".layui-tab-title").children();
                var flag = true;   //判断右侧是否已经有了该选项卡，有了就不生成了
                $.each(tabs, function (i, item) {
                    var tabid = $(item).attr("lay-id");
                    if (tabid == layid) { //如果已经打开了这个标签
                        flag = false;
                    }
                });
                if (flag) {
                    element.tabAdd('mytab', {
                        title: text,
                        content: "<iframe frameborder=0 style='width:100%;height:100%;'  src='" + dataurl + "' />",
                        id: layid
                    });
                }

                //让点击的选项卡选中
                element.tabChange('mytab', layid);
            });
        });
    </script>

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 导航栏 -->
    <div class="layui-header">
        <a href="#" class="layui-logo">
            <span class="layui-logo-mini">学生端</span>
            <span class="layui-logo-lg">学生端</span>
        </a>
        <a class="side-toggle layui-layout-left" href="#">
            <i class="layui-icon layui-icon-shrink-right"></i>
            <i class="layui-icon layui-icon-spread-left"></i>
        </a>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a class="timo-screen-full" href="#">
                    <i class="fa layui-icon layui-icon-screen-full"></i>
                </a>
            </li>
            <li class="layui-nav-item timo-nav-user">
                <a class="timo-header-nickname">${sessionScope.STUNAME}<span class="layui-nav-more"></span></a>
                <div class="layui-nav-child layui-anim layui-anim-upbit">
                    <div class="timo-nav-child-box">
                        <div><a href="${pageContext.request.contextPath}/studentLogin/goexit"><i class="fa fa-power-off"></i>退出登录</a></div>
                    </div>
                </div>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <!-- 左侧栏 -->
    <div class="layui-side layui-bg-black">
        <div class="layui-side layui-bg-black">
            <!-- 垂直导航 -->
            <div class="layui-side-scroll">
                <div class="layui-side-user">
                    <img class="layui-side-user-avatar" src="${pageContext.request.contextPath}/static/images/face.webp"
                         alt="头像">
                    <div>
                        <p class="layui-side-user-name">${sessionScope.STUNAME}</p>
                        <p class="layui-side-user-designation">在线</p>
                    </div>
                </div>
                <ul class="layui-nav layui-nav-tree">
                    <li class="layui-nav-item">
                        <a href="#" data-url="${pageContext.request.contextPath}/holidaystudent/topersonage"
                           tab_id="33">个人主页</a>
                    </li>

                    <li class="layui-nav-item">
                        <a href="#" data-url="${pageContext.request.contextPath}/holidaystudent/stugoholiday"
                           tab_id="34">我要请假</a>
                    </li>

                    <li class="layui-nav-item">
                        <a href="#" data-url="${pageContext.request.contextPath}/holidaystudent/toaddweixiu"
                           tab_id="27">我要报修</a>
                    </li>

                    <li class="layui-nav-item">
                        <a href="#" data-url="${pageContext.request.contextPath}/holidaystudent/xstolist"
                           tab_id="35">教师考评</a>
                    </li>

                    <li class="layui-nav-item">
                        <a href="#" data-url="${pageContext.request.contextPath}/holidaystudent/tofankuiadd"
                           tab_id="36">问题反馈</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <!-- 主体区域 -->
    <div class="layui-body layui-tab layui-tab-brief" lay-allowclose="true" lay-filter="mytab">
        <!-- 标签栏 -->
        <ul class="layui-tab-title">
            <li lay-id="home.html" class="layui-this"><i class="layui-icon layui-icon-home"></i><span
                    class="layui-nav-title">主页</span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i></li>
        </ul>
        <!-- 内容区域 -->
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src="${pageContext.request.contextPath}/studentLogin/gostuhome" frameborder="0"
                        class="layui-layout-iframe"></iframe>
                <iframe src="${pageContext.request.contextPath}/notice/noticeLists" frameborder="0"
                        class="layui-layout-iframe"></iframe>
            </div>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/static/js/main.js" charset="utf-8"></script>
</body>
</html>

